#ifndef __DBWINDOW_H__
#define __DBWINDOW_H__

#include <gdk/gdkevents.h>
#include <gtkmm/window.h>
#include <gtkmm/spinbutton.h>
#include <gtkmm/adjustment.h>
#include <gtkmm/scale.h>
#include <gtkmm/table.h>
#include <gtkmm/widget.h>

#include "audio.h"

#define TAP_SOUND "metronome.wav"

using namespace Gtk;

class dbWindow : public Gtk::Window
{
public:
  dbWindow();
  ~dbWindow();

  bool operator! () const;

private:
  int key_pressed (Widget *w, GdkEventKey *evt);
  void bpm_spin_button_value_changed ();
  void beat_spin_button_value_changed ();
  void start_stop_button_toggled ();
  void accent_scale_value_changed ();
  void quarter_scale_value_changed ();
  void eight_scale_value_changed ();
  void sixteen_scale_value_changed ();
  void triplet_scale_value_changed ();
  void master_scale_value_changed ();

  bool _error;

  Table _table;
  Adjustment _bpm_adjustment;
  SpinButton _bpm_spin_button;
  Label _bpm_label;
  Adjustment _beat_adjustment;
  SpinButton _beat_spin_button;
  Label _beat_label;
  Adjustment _accent_adjustment;
  VScale _accent_scale;
  Label _accent_label;
  Adjustment _quarter_adjustment;
  VScale _quarter_scale;
  Label _quarter_label;
  Adjustment _eight_adjustment;
  VScale _eight_scale;
  Label _eight_label;
  Adjustment _sixteen_adjustment;
  VScale _sixteen_scale;
  Label _sixteen_label;
  Adjustment _triplet_adjustment;
  VScale _triplet_scale;
  Label _triplet_label;
  Adjustment _master_adjustment;
  HScale _master_scale;
  Label _master_label;
  ToggleButton _start_stop_button;

  AudioParams cb_params;
};

#endif
